<UserControl x:Class="WPFExcelReport.VWVKP"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"                    
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"                     
                    FontSize="12"
                    Loaded="Window_Loaded"
>
    <UserControl.Resources>
        <ucd:BoolToVisibilityConverter x:Key="bv"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1440  x:Key="day"/>
        <ucd:Divideby480  x:Key="shift"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter x:Key="Trim"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <db:SETINTEXDB  x:Key="SetVKK" />
        <db:SETINTEXDB  x:Key="SetVKP" />
        <CollectionViewSource   x:Key="vwMKRF" Source="{Binding Path=SetData.ICC_MKRF}" />
        <CollectionViewSource   x:Key="vwRULES" Source="{Binding Path=SetEnv.ICC_SRULES}" />
        <CollectionViewSource   x:Key="vwSTDAM" Source="{Binding Path=SetEnv.ICC_STDMACHINE}" />
        <CollectionViewSource   x:Key="vwMRILI" Source="{Binding Path=SetProd.ICC_MKRF}" />
        <CollectionViewSource   x:Key="vwAMSTAMM" Source="{Binding Path=SetEnv.AMSTAMM}" />
        <CollectionViewSource   x:Key="vwFMKRF" Source="{Binding Path=SetProd.FMKRF}" />
        <CollectionViewSource   x:Key="vwVKPMKRF" Source="{Binding Path=SetVKP.VKPMKRF}" />
        <CollectionViewSource   x:Key="vwVKKMKRF" Source="{Binding Path=SetVKK.VKKMKRF}" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=SetData.ABPOS}" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <WrapPanel>
                <TextBlock  Text="{Binding Source={Localization:TranslateExtension Word=显示:}}" VerticalAlignment="Center"></TextBlock>
                <ComboBox Name="Density" Width="40"  Text="8" SelectionChanged="Density_SelectionChanged">
                    <ComboBoxItem>2</ComboBoxItem>
                    <ComboBoxItem>4</ComboBoxItem>
                    <ComboBoxItem>8</ComboBoxItem>
                    <ComboBoxItem>12</ComboBoxItem>
                    <ComboBoxItem>16</ComboBoxItem>
                    <ComboBoxItem>24</ComboBoxItem>
                    <ComboBoxItem>48</ComboBoxItem>
                    <ComboBoxItem>72</ComboBoxItem>
                </ComboBox>
                <TextBlock Name="txtDen" Text="{Binding Source={Localization:TranslateExtension Word=8小时}}" VerticalAlignment="Center"></TextBlock>
                <WrapPanel>
                    <Button  Width="20" Height="20" Margin="10,0,0,0"  Click="btnRefresh_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/IntexReportClient;component/Images/Refresh.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=更新}}"></TextBlock>
                 
                </WrapPanel> 
                <Button  Width="20" Height="20"   Margin="10,0,0,0"  Click="btnPlan_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="/IntexReportClient;component/Images/memory.png" />
                    </Button.Background>
                </Button>
                <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=排产}}"></TextBlock>
            </WrapPanel>
            <WrapPanel Visibility="Collapsed">
                <TextBlock Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=机台}}" VerticalAlignment="Center"/>
                <TextBox VerticalAlignment="Center" Background="White" BorderBrush="Black"    Width="20" Margin="1,0,0,0" Text="{Binding ABFBNRKRS, Source={StaticResource ResourceKey=vwMKRF}}" />
                <TextBox VerticalAlignment="Center" Background="White"  BorderBrush="Black"   Width="60" Margin="1,0,0,0" Text="{Binding ABFBLFDNR, Source={StaticResource ResourceKey=vwMKRF}}" />
                <TextBox  VerticalAlignment="Center" Background="White"  BorderBrush="Black"  Width="30"   Margin="1,0,0,0" Text="{Binding ABFBPOS, Source={StaticResource ResourceKey=vwMKRF}}" />
                <TextBlock VerticalAlignment="Center" Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=日期}}" />
                <TextBox  VerticalAlignment="Center" Background="White"  BorderBrush="Black"  Width="80"   Margin="1,0,0,0" Text="{Binding MKFPLDATV, Source={StaticResource ResourceKey=vwMKRF}}" />
                <TextBlock VerticalAlignment="Center" Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=时间}}" />
                <TextBox  VerticalAlignment="Center" Background="White"  BorderBrush="Black"  Width="80"   Margin="1,0,0,0" Text="{Binding MKFPLTIME, Source={StaticResource ResourceKey=vwMKRF}}" />
                <TextBlock VerticalAlignment="Center" Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=班次}}" />
                <TextBox VerticalAlignment="Center" Background="White"  BorderBrush="Black"  Width="30"   Margin="1,0,0,0" Text="{Binding MKFSCHICHTV, Source={StaticResource ResourceKey=vwMKRF}}" />

                <TextBlock   Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=数量}}" VerticalAlignment="Center" />
                <TextBlock VerticalAlignment="Center" Background="White"  Width="40" Text="{Binding Path=MKFSMG5, Source={StaticResource ResourceKey=vwMKRF},Converter={StaticResource ResourceKey=d100}}" Margin="5,0,0,0"  />

                <Button VerticalAlignment="Center" Content="{Binding Source={Localization:Translate Word=查看}}"   Margin="10,0,0,0" Width="Auto" Click="btnEditJob_Click"/>
               
                <TextBlock Margin="5,0,0,0" Text="{Binding Source={Localization:TranslateExtension Word=类型}}" VerticalAlignment="Center" Visibility="Collapsed"></TextBlock>
                <ComboBox Name="cmbStype" Width="50" SelectionChanged="cmbStype_SelectionChanged" Visibility="Collapsed"/>
                <Button   Width="Auto"  Margin="10,0,0,0" Content="{Binding Source={Localization:Translate Word=当前}}"  VerticalAlignment="Center" Click="Current_Click" />

                <TextBlock   Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=加工中心}}"  VerticalAlignment="Center" />
                <TextBox Background="White"   Width="20" Name="txtKSTKRS" CharacterCasing="Upper" Margin="10,0,0,0" Text="  "  VerticalAlignment="Center"/>
                <TextBox Background="White"   Width="40" Name="txtFKST"   Margin="10,0,0,0" Text="0400"  VerticalAlignment="Center"/>
                <TextBox Background="White"   Width="20" Name="txtAGANG"   Margin="10,0,0,0" Text="XS"  VerticalAlignment="Center"/>
                <TextBox Background="White"   Width="20" Name="txtMachTyp"   Margin="10,0,0,0" Text="XS"  VerticalAlignment="Center"/>
                <TextBlock   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=机台}}"  VerticalAlignment="Center"/>

                <ComboBox  ItemsSource="{Binding Source={StaticResource ResourceKey=vwAMSTAMM}}"
                                   Margin="10,0,0,0"  FontSize="18"
                                   SelectionChanged="AM_SelectionChanged"
                                   Background="White"  MinWidth="80" 
                                   DisplayMemberPath="AMBEZ"
                                   IsEditable="True"
                                   VerticalAlignment="Center"
                                   SelectedValuePath="AMBEZ"
                       />

                <Button   Width="Auto"  Margin="5,0,0,0" Content="{Binding Source={Localization:Translate Word=排产规则}}"  VerticalAlignment="Center" Click="btnShowExt1_Click"/>
                <Button   Width="Auto"  Margin="5,0,0,0" Content="{Binding Source={Localization:Translate Word=同类订单}}"  VerticalAlignment="Center" Click="btnShowExt2_Click"/>
                <Button   Width="Auto"  Margin="5,0,0,0" Content="{Binding Source={Localization:Translate Word=生产单}}"  VerticalAlignment="Center" Click="btnShowExt3_Click"/>

            </WrapPanel>
            <WrapPanel Visibility="Collapsed">
                <TextBlock   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=生产批次}}" />
                <TextBox Background="White"  Width="30" Name="txtABPAUFKRS" CharacterCasing="Upper" Margin="5,0,0,0" Text="" />
                <TextBox Background="White"  Width="80" Name="txtABPAUFLFD"   Margin="5,0,0,0" Text="" />
                <TextBox  Background="White"  Width="40" Name="txtABPAUFPOS"   Margin="5,0,0,0" Text="" />
                <TextBox  Background="White"  Width="40" Name="txtABPMKFTP"   Margin="5,0,0,0" Text="" />
                <TextBlock Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=仅未确认}}"  VerticalAlignment="Center"/>
                <CheckBox Name="chkS" VerticalAlignment="Center" Margin="10,0,0,0"></CheckBox>
                <Button Content="{Binding Source={Localization:Translate Word=查找}}"   Margin="10,0,0,0" Width="Auto" Click="btnSearch_Click"/>
                <Button Content="{Binding Source={Localization:Translate Word=筛选}}"   Margin="10,0,0,0" Width="Auto" Click="btnJobFilter_Click"/>
                <Button Content="{Binding Source={Localization:Translate Word=显示所有}}"   Margin="10,0,0,0" Width="Auto" Click="btnShowAllJob_Click"/>
                <TextBlock  Background="White"  Width="40" Text="{Binding Path=MKFTP, Source={StaticResource ResourceKey=vwMKRF},Converter={StaticResource ResourceKey=pnum}}" Margin="5,0,0,0"  />
                <TextBlock  Background="White"  Width="40" Text="{Binding Source={Localization:Translate Word=按机型}}" Margin="5,0,0,0"  />
                <CheckBox Name="chkMType" VerticalAlignment="Center" Margin="10,0,0,0" IsChecked="False"></CheckBox>
            </WrapPanel>
            <WrapPanel Name="Board" Visibility="Collapsed">
                <TextBlock Text="{Binding Source={Localization:Translate Word=任务个数:}}" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding Source={Localization:Translate Word=0}}" Width="60" Name="txtJNUM"></TextBlock>
                <TextBlock Text="{Binding Source={Localization:Translate Word=任务数量:}}"></TextBlock>
                <TextBlock Text="{Binding Source={Localization:Translate Word=0}}" Width="100" Name="txtJQTY"></TextBlock>
                <TextBlock Text="{Binding Source={Localization:Translate Word=拖期个数:}}"></TextBlock>
                <TextBlock Text="{Binding Source={Localization:Translate Word=0}}" Width="60" Name="txtDJNUM"></TextBlock>
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="0" Grid.RowSpan="3" Grid.Column="3" Visibility="Collapsed">
          <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="0" Margin="0,0,0,0.0" Grid.RowSpan="2" Name="ZoneExt1" Visibility="Collapsed">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Row="0" Text="{Binding Source={Localization:TranslateExtension Word=排产规则}}" ></TextBlock>
                    <DataGrid  Grid.Row="1"
                                       Height="200"
                                       CanUserReorderColumns="True"  
                                       FontSize="12"
                                       HorizontalScrollBarVisibility="Auto"
                                       VerticalScrollBarVisibility="Auto"
                                       CanUserResizeRows="True" CanUserSortColumns="True"                  
                                       AutoGenerateColumns="False"   
                                       EnableRowVirtualization="True"  
                                       RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                       IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwRULES}}"  
                                       >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ROWNID, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=ID}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MACHINEID}" Header="{Binding Source={Localization:TranslateExtension Word=设备类型}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=RGROUP}" Header="{Binding Source={Localization:TranslateExtension Word=组}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=JOBVDES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=任务属性类型}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=JOBV}" Header="{Binding Source={Localization:TranslateExtension Word=任务值}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=LOGIC}" Header="{Binding Source={Localization:TranslateExtension Word=运算}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=RVALUE}" Header="{Binding Source={Localization:TranslateExtension Word=规则值}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=RULEDES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=规则描述}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=POINTS}" Header="{Binding Source={Localization:TranslateExtension Word=点数}}"  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                    <DataGrid  Grid.Row="2"
                                       Margin="0,0,0,0"
                                       Height="200"
                                       CanUserReorderColumns="True"  
                                       FontSize="12"
                                       CanUserResizeRows="True" CanUserSortColumns="True"                  
                                       AutoGenerateColumns="False"   
                                       EnableRowVirtualization="True"  
                                       HorizontalScrollBarVisibility="Auto"
                                       VerticalScrollBarVisibility="Auto"
                                       RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                       IsSynchronizedWithCurrentItem="True"   Visibility="Visible"
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwSTDAM}}"  
                  >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=MACHINEID}" Header="{Binding Source={Localization:TranslateExtension Word=设备类型}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=SMTYP}" Header="{Binding Source={Localization:TranslateExtension Word=分组标识}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=JMVALUE}" Header="{Binding Source={Localization:TranslateExtension Word=测试值}}"  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                </Grid>
                <Grid Grid.Column="1" Margin="0,0,0,0" Name="ZoneExt2" Visibility="Collapsed">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Row="0">同色号</TextBlock>
                    <DataGrid  Grid.Row="1" Name="dgColor"
                                       CanUserReorderColumns="True"  
                                       Height="200"
                                       FontSize="12"
                                       CanUserResizeRows="True" CanUserSortColumns="True"                  
                                       AutoGenerateColumns="False"   
                                       EnableRowVirtualization="True"  
                                       RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                       IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                                            HorizontalScrollBarVisibility="Auto"
                                        VerticalScrollBarVisibility="Auto"
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwFMKRF}}"   
                                       >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFPLDATV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=机台}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                    <TextBlock Grid.Row="2">同品种</TextBlock>
                    <DataGrid   Grid.Row="3"
                                        CanUserReorderColumns="True"  
                                        FontSize="12"
                                        CanUserResizeRows="True" CanUserSortColumns="True"                  
                                        AutoGenerateColumns="False"   
                                        EnableRowVirtualization="True"  
                                        RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                        HorizontalScrollBarVisibility="Auto"
                                        VerticalScrollBarVisibility="Auto"
                                        IsSynchronizedWithCurrentItem="True"   Visibility="Visible"
                        Height="200"                        
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPMKRF}}"  
                  >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=花型}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=机台}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBPOS}" Header=""  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                    <TextBlock Grid.Row="4">同任务书</TextBlock>
                    <DataGrid   Grid.Row="5"
                                        CanUserReorderColumns="True"  
                                        FontSize="12"
                                        CanUserResizeRows="True" CanUserSortColumns="True"                  
                                        AutoGenerateColumns="False"   
                                        EnableRowVirtualization="True"  
                                        RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                        IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                        HorizontalScrollBarVisibility="Auto"
                                        VerticalScrollBarVisibility="Auto"
                                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKKMKRF}}"   
                                        Height="200"
                  >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFPLDATV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=花型}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=机台}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                </Grid>
            </Grid>
        </StackPanel>
      
        <Grid Grid.Row="0" Grid.RowSpan="4" Grid.Column="4" Name="ZoneExt3">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>            
                <DataGrid  Grid.Row="1" CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwMKRF}}"  x:Name="dlgABP" 
                  >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=JOBTYPE}" Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABKKDAUFTNR}" Header="{Binding Source={Localization:TranslateExtension Word=计划组}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAUFKRS}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=MKFTP, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=分批}}"  Width="Auto" />
                        <!-- Binding="{Binding Path=ABFAFOLGE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=步骤}}"  Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=ABFAGANG}" Header="{Binding Source={Localization:TranslateExtension Word=操作}}"  Width="Auto" /-->
                        <DataGridTextColumn Binding="{Binding Path=ABFMNRKRS}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFMLFDNR}" Header="{Binding Source={Localization:TranslateExtension Word=加工}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFMPOS}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=JP05}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFSOLLSTART}" Header="{Binding Source={Localization:TranslateExtension Word= 上机}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFSOLLDAT}" Header="{Binding Source={Localization:TranslateExtension Word=完成}}"  Width="Auto" />
                        <DataGridTextColumn FontSize="14" Foreground="Red" Binding="{Binding Path=ABFBNRKRS}" Header=" "  Width="Auto" />
                        <DataGridTextColumn FontSize="14" Foreground="Red" Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=排产}}"  Width="Auto" />
                        <DataGridTextColumn FontSize="14" Foreground="Red"  Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Header="{Binding Source={Localization:TranslateExtension Word=开始}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=MKFPLTIME}"    Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ENDATE}" Header="{Binding Source={Localization:TranslateExtension Word=结束}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ENDTIME}"    Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAMASCHZT, Converter={StaticResource ResourceKey=day}}" Header="{Binding Source={Localization:TranslateExtension Word=天数}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAMASCHZT, Converter={StaticResource ResourceKey=shift}}" Header="{Binding Source={Localization:TranslateExtension Word=H8}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAMASCHZT}" Header="{Binding Source={Localization:TranslateExtension Word=分钟}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=JP01}" Header="{Binding Source={Localization:TranslateExtension Word=纱支}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=JP04}" Header="{Binding Source={Localization:TranslateExtension Word=产品组}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=JP05}" Header="{Binding Source={Localization:TranslateExtension Word=重量}}"  Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid> 
        <ex:AniScrollViewer  Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"   Name="vwCalendar" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"  >

            <StackPanel>
                <StackPanel Name="ZoneCalendar" Orientation="Horizontal">
                </StackPanel>
            </StackPanel>
        </ex:AniScrollViewer>
        <ex:AniScrollViewer  Grid.Row="2" Grid.Column="0"     Name="vwMachine"  VerticalScrollBarVisibility="Hidden"  Visibility="Collapsed"
                                     ScrollChanged="vwMachine_ScrollChanged"
                                     >
            <StackPanel>
                <StackPanel Name="MachineTable" ></StackPanel>
            </StackPanel>
        </ex:AniScrollViewer>
        <ex:AniScrollViewer  Grid.Row="2"  Grid.Column="1" Grid.ColumnSpan="2"    Name="mainViewer"  
                                     ScrollChanged="mainViewer_ScrollChanged"
                                     HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible">
            <StackPanel>
                <StackPanel Name="machines" >
                </StackPanel>
            </StackPanel>
        </ex:AniScrollViewer>
    </Grid>
</UserControl>

    
